<template>
	<z-paging ref="paging" v-model="list" @query="orderList">
		<template v-if="current === 0">
			<view class="d-p-l-30 d-p-r-30">
				<view class="d-list-box d-m-t-20 d-p-20 d-flex d-col-top d-boe" v-for="(item, index) in list"
					:key="index">
					<u-image :src="picture" width="20vw" height="20vw"></u-image>
					<view class="d-m-l-20 d-flex-1">
						<!-- <view class="d-m-t-60 d-font-30 d-red">
								<text class="d-font-24">教练：</text>
								<text class="d-bold">陈明昕</text>
							</view> -->
						<view class="d-font-34 d-white d-bolda" v-if="item.product_type == 'ticket'">{{item.consumetype}}{{item.chargetype}}</view>
						<view class="d-font-34 d-white d-bolda" v-else>{{item.cardtype}}</view>
						<view class="d-font-26 d-white" style="margin-top: 20rpx;color: #ffaa00;" >{{item.product_price}}元</view>
						<!-- <view class="d-font-26 d-white">交易时间：{{item.billtime}}</view>
						<view class="d-font-26 d-white">订单号：{{item.outtradeno}}</view> -->
						<view class="d-font-26 d-white" style="color: #adadad;">兑换地点：{{item.salevenue}}</view>
						<!-- <view class=" d-font-30 d-white">
								<text class="d-font-30">联系电话：</text>
								<text class="d-bold">18659205213</text>
							</view> -->
						<!-- <view class="d-flex d-m-t-18">
								<view class="d-tag d-flex">{{ item.specify }}</view>
							</view>
							<view class="d-font-24 d-be d-m-t-20">{{ item.tip }}</view>
							<view class="d-font-24 d-be d-m-t-20" style="margin-left: 47rpx;">{{ item.text }}</view> -->

					</view>
					<view class="btn-tlty" @click="cardDetail(item)">
						<!-- <view class="btn-money">
							￥{{item.product_price}}
						</view> -->
						<view class="btn-shiyong">
							去使用
						</view>
					</view>
				</view>
			</view>
		</template>
		<customer-Kefu></customer-Kefu>
	</z-paging>
</template>

<script>
	import {
		scoreorder
	} from '@/common/api';
	import customerKefu from '../../components/customerKefu/customerKefu.vue';
	export default {
		components: {
			customerKefu
		},
		data() {
			return {
				current: 0,
				list: [],
				picture: '../../static/logo.png',
			};
		},
		onLoad(e) {
			if (e.token) {
				uni.$u.vuex('$token', e.token);
			}
		},
		methods: {
			orderList(page, limit) {
				scoreorder()
					.then(res => {
						console.log(res, '9966')
						this.$refs.paging.complete(res);
					})
					.catch(err => {
						this.$ref.paging.complete(false);
					});
			},

			cardDetail(item) {
				if (item.product_type == 'ticket') {
					uni.$u.route({
						url: '/pageA/ewm_jifen/ewm_jifen',
						params: {
							ticketno: item.ticketno,
							product_type: item.product_type
						}
					});
				} else {
					uni.$u.route({
						url: '/pageA/ewm_jifen/ewm_jifen',
						params: {
							ticketno: item.insideno,
							product_type: item.product_type
						}
					});
				}
			},
		}
	};
</script>

<style lang="scss" scoped>
	.d-list-box {
		// box-shadow: 0rpx 13rpx 57rpx 0rpx rgba(8, 73, 162, 0.11);
		// background: rgb(48,182,134);
		// border-radius: 10rpx;
	}

	.d-tag {
		background: #f3f3f3;
		border-radius: 4rpx;
		height: 36rpx;
		font-size: 24rpx;
		font-weight: 500;
		color: #333333;
		padding: 0 18rpx;
	}

	.d-be {
		color: #bebebe;
	}

	.d-red {
		color: #ff0000;
		margin-top: 10rpx !important;
	}

	.d-white {
		color: #000000;
		// margin-top: 10rpx !important;
	}

	.d-xuxian {
		width: 100%;
		height: 1rpx;
		border-bottom: 1px solid #acacac;
		margin-top: 10rpx;
	}

	.d-bold {
		color: #00a7ff;
	}

	.d-bolda {
		font-weight: bold;
	}

	.d-jule {
		margin-top: 20rpx;
	}

	.btn-tlty {
		width: 13vw;
		line-height: 9vw;
		color: #000;
		text-align: center;
		margin-top: 30rpx;

		.btn-money {
			color: #fd6e4c;
		}

		.btn-shiyong {
			width: 14vw;
			line-height: 8vw;
			background-color: #00aaff;
			color: white;
			border-radius: 6vw;
			font-size: 22rpx;
			margin-top: 30rpx;
		}
	}

	.d-boe {
		border-bottom: 1rpx solid #ddd;
	}
</style>